package com.croot.infra.${projectFlag}.dto.response;
import java.util.Date;
import com.croot.infra.${projectFlag}.adapter.rdb.po.${entityName}PO;
import java.util.Objects;
import lombok.Data;

@Data
public class ${entityName}RespDTO {

<#list columnInfos as column>
   <#if column.humpColumnName ?ends_with("id")
    || column.humpColumnName ?ends_with("Id")
   >
    private String ${column.humpColumnName!};

    <#else>
    private ${column.humpColumnNameType!} ${column.humpColumnName!};

   </#if>
</#list>
    public static ${entityName}RespDTO buildFromPO(${entityName}PO ${entityParamName}PO) {
        ${entityName}RespDTO ${entityParamName}RespDTO = new ${entityName}RespDTO();

<#list columnInfos as column>
        if (Objects.nonNull(${entityParamName}PO.get${column.humpColumnName! ? cap_first}())) {
    <#if column.humpColumnName ?ends_with("id")
    || column.humpColumnName ?ends_with("Id")>
            ${entityParamName}RespDTO.set${column.humpColumnName! ? cap_first}(String.valueOf(${entityParamName}PO.get${column.humpColumnName! ? cap_first}()));
    <#else>
            ${entityParamName}RespDTO.set${column.humpColumnName! ? cap_first}(${entityParamName}PO.get${column.humpColumnName! ? cap_first}());
    </#if>
        }
</#list>

        return ${entityParamName}RespDTO;
    }
}
